-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add ns and us for config duration units #6654
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6654 +/- ##
============================================
- Coverage 90.05% 90.05% -0.01%
- Complexity 6276 6278 +2
============================================
Files 697 697
Lines 18949 18951 +2
Branches 1858 1858
============================================
+ Hits 17065 17066 +1
Misses 1312 1312
- Partials 572 573 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable. Out of curiosity, what's the motivation? Which properties are you trying to configure to this level of granularity?
For the span stacktrace we need to define a In the mean time I've updated the tests in the PR to use milliseconds as the feature does not require such short durations, however there should not be any limitation on the configuration options. In practice for this span stacktrace feature, I don't expect end-users to use nanosecond granularity, however having the ability to configure it with less than a millisecond would be relevant for example to help identify what triggers very short-lived spans like a call to an in-memory cache which can be less than a millisecond. |
When using autoconfiguration SPI, configuration options can be parsed as a
java.time.Duration
by usingConfigProperties#getDuration
.However, the nanoseconds and microseconds are not supported, the smallest unit we can use is milliseconds (which is also the default).
This PR adds support for both nanoseconds
ns
and microsecondsus
.Also, this adds a test to ensure using a negative duration can be used as a way to mark a configuration option as disabled (no change in implementation needed though).